import { http } from "@/utils/http";

export type ResultType = ReplaceTargetType<any[]>;

// 查询类型列表
export const entityTypeListApi = (params) => {
  return http.request<any>({
    url: "/kg-service/kg/search/v1.0/all/entity_type/page",
    method: "get",
    params: params,
  });
};

// 查询类型列表
export const entityTypePropApi = (params) => {
  return http.request<ResultType>({
    url: "/kg-service/kg/search/v1.0/entity_type/properties",
    method: "get",
    params: params,
  });
};

// 查询实体类型列表
export const entityListApi = (params) => {
  return http.request<any>({
    url: "/kg-service/kg/search/v1.0/entity/page",
    method: "post",
    params: {},
    data: params,
  });
};

// 查询实体类型详情
export const entityDetailApi = (params) => {
  return http.request<any>({
    url: "/kg-service/kg/search/v1.0/entity/detail",
    method: "get",
    params: params,
    data: {},
  });
};

// 知识分享
export const kgShareApi = (params) => {
  return http.request<any>({
    url: "/kg-service/kg/v1.0/share",
    method: "post",
    params: {},
    data: params,
  });
};

// 知识分享
export const getShareListApi = (params) => {
  return http.request<any>({
    url: "/kg-service/kg/v1.0/share_to_me/page",
    method: "get",
    params: params,
    data: {},
  });
};

// 知识分享
export const shareIsreadApi = (params) => {
  return http.request<any>({
    url: "/kg-service/kg/v1.0/share/is_read",
    method: "get",
    params: params,
    data: {},
  });
};

// 关联分析
export const LinkAnalyseApi = (params) => {
  return http.request<any>({
    url: "/kg-service/entity/tags-id/query",
    method: "get",
    params: params,
    data: {},
  });
};
